import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./assets/css/global.css";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import axios from "axios";
//引入 echarts
import * as echarts from 'echarts';

// import x2js from 'x2js' //xml数据处理插件
// Vue.prototype.$x2js = new x2js() //全局方法挂载

import { MessageBox } from "element-ui";
import { Message } from "element-ui";

//注册组件
Vue.prototype.$echarts = echarts;
// 挂载到$message上
Vue.prototype.$message = Message;
Vue.prototype.$confirm = MessageBox.confirm;

Vue.prototype.$http = axios;
// Vue.prototype.$axios = axios
axios.defaults.baseURL = "/api"; // 开发本地代理application/json
// axios.defaults.headers.post["Contenst-Type"] = "application/json;charset=UTF-8";

// Vue.prototype.$ajax = axios;
// axios.defaults.baseURL = "/api"; // 开发本地代理
// axios.defaults.headers.post["Contenst-Type"] =
//   "application/x-www-form-urlencoded";

Vue.use(ElementUI);
Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
